/**
 * 
 */
package it.irondev.appturismo.action;

import it.irondev.appturismo.entity.Gallery;
import it.irondev.appturismo.entity.Media;
import it.irondev.appturismo.service.IGalleryService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

/**
 * @author federico
 *
 */
@Controller("galleryAction")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class GalleryAction extends AbstractAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3453211279119227999L;

	@Autowired
	IGalleryService galleryService;
	
	private Long idGallery;
	
	private Long idEntity;
	
	private Integer idMedia;

	private Gallery entityBean;
	
	private Media media;
	
	public String list() {
		return null;
	}

	public String addMedia() {
		galleryService.addMedia(media);
		idGallery=media.getIdgallery().longValue();
		return "addMedia";
	}
	
	public String deleteMedia() {
		galleryService.deleteMedia(idMedia);
		return "deleteMediaGallery";
	}
	
	
	public String listJson() {
		return null;
	}

	public String nuovo() {
		return "newGallery";
	}

	public String edit() {
		entityBean = galleryService.getGalleryById(idGallery.intValue());
		return "editGallery";
	}

	public void delete() {
		// TODO Auto-generated method stub

	}

	public String update() {
		// TODO Auto-generated method stub
		return null;
	}

	public String add() {
		// TODO Auto-generated method stub
		return null;
	}
	
	
	/**
	 * @return the idGallery
	 */
	public Long getIdGallery() {
		return idGallery;
	}

	/**
	 * @param idGallery the idGallery to set
	 */
	public void setIdGallery(Long idGallery) {
		this.idGallery = idGallery;
	}

	/**
	 * @return the idEntity
	 */
	public Long getIdEntity() {
		return idEntity;
	}

	/**
	 * @param idEntity the idEntity to set
	 */
	public void setIdEntity(Long idEntity) {
		this.idEntity = idEntity;
	}

	/**
	 * @return the entityBean
	 */
	public Gallery getEntityBean() {
		return entityBean;
	}

	/**
	 * @param entityBean the entityBean to set
	 */
	public void setEntityBean(Gallery entityBean) {
		this.entityBean = entityBean;
	}


	/**
	 * @return the media
	 */
	public Media getMedia() {
		return media;
	}


	/**
	 * @param media the media to set
	 */
	public void setMedia(Media media) {
		this.media = media;
	}

	/**
	 * @return the idMedia
	 */
	public Integer getIdMedia() {
		return idMedia;
	}

	/**
	 * @param idMedia the idMedia to set
	 */
	public void setIdMedia(Integer idMedia) {
		this.idMedia = idMedia;
	}


}
